<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
<%@ taglib prefix="fn" uri="http://java.sun.com/jsp/jstl/functions"%>
<c:set var="ctx" value="${pageContext.request.contextPath}"/>

<head>

<script>
	var registerCharges = [];
	
</script>

<c:forEach items="${registerCharges}" var="registerCharge">
	<script type="text/javascript">
		var registerCharge = {
			'id':"${registerCharge.id}",
			'partOfBody': "${registerCharge.partOfBody}",
			'xRayAddTime': "${registerCharge.xRayAddTime}",
			'chargeTime':"${registerCharge.chargeTime}",
			'addTime':"${registerCharge.addTime}",
			'imageSrc':"${registerCharge.imageSrc}",
			'timeSegment':"${registerCharge.timeSegment}",
			'departmentName':"${registerCharge.departmentName}",
			'doctorName':"${registerCharge.doctorName}",
			'seq':"${registerCharge.seq}"
		};
		registerCharges.push(registerCharge);
	</script>
</c:forEach>

<script type="text/javascript">
	
	$(function() {
		dataGrid = $('#dataGrid').datagrid({
			striped : true,
			rownumbers : true,
			singleSelect : true,
			idField : 'id',
			sortName : 'id',
			sortOrder : 'asc',
			columns :[[{
				width : '100',
				title : '时间段',
				field : 'timeSegment'
			},{
				width : '50',
				title : '排序号',
				field : 'seq'
			},{
				width : '80',
				title : '挂号科室',
				field : 'departmentName'
			},{
				width : '80',
				title : '就诊医生',
				field : 'doctorName'
			},{
				width : '100',
				title : '身体部位',
				field : 'partOfBody'
			},{
				width : '150',
				title : '开单时间',
				field : 'addTime',
			},{
				width : '150',
				title : '缴费时间',
				field : 'chargeTime'
			}, {
				width : '150',
				title : '拍片时间',
				field : 'xRayAddTime'
			}, {
				field : 'imageSrc',
				title : '拍片图像',
				width : 80,
				formatter : function(value, row, index) {
					var str = '&nbsp;';
					str += $.formatString('<a href="${ctx}/{0}" target="_blank"><img src="${ctx}/{1}" width="45"/></a>', row.imageSrc,row.imageSrc);
					return str;
				}
			} ] ],
			data: registerCharges
		});
	});

</script>
</head>

<div class="easyui-layout" data-options="fit:true,border:false">
	
	<div data-options="region:'center',fit:true,border:false">
		<table id="dataGrid" data-options="fit:true,border:false"></table>
	</div>
</div>
